<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MQ</title>
<script type="text/javascript" src="../scripts/jquery-1.4.2.src.js"></script>
<link href="../css/mq.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">	
function resetPassword(form){
	$.ajax({
      url: 'resetUserPassword.do',
      type: 'GET',
      data: {
        pid: form.id
      },
      error: function(xhr) {
        alert('密码重置出错');
      },
      success: function(response) {
          alert(response);
      }
    });
 }
</script>
</head>

<body>
<!--------------------------------------- -->
<div id="contentMain">
<form action="deleteAdminUser.do" method="post" name="/admin">
    <table width="100%" border="0" cellspacing="1" cellpadding="2" class="TableStyle">
<tr class="TrTitleBg-2">
  	<td width="2%"></td>
  	<td width="4%">序号</td>
    <td width="11%">登录名</td>
    <td width="15%">公司名</td>
    <td width="10%">联系人</td>
    <td width="12%">联系人手机</td>
    <td width="18%">地址</td>
    <td width="9%">公司类别</td>
    <td width="15%">操作</td>
  </tr>
  <s:iterator value="adminUserList"  status="st">
  <tr class="TrWhiteBg">
  	<td><input type="checkbox" name="ids" value="${id }" /></td>
  	<td>${st.count }</td>
    <td>${adminUserName}</td>
    <td>${companyName}</td>
    <td>${contact}</td>
    <td>${mobile} </td>
    <td>${address}</td>
    <td>${companyType}</td>
    <td><a href="toEditSubAdminUser.do?id=${id }">编辑</a> <a href="#" onclick="resetPassword(this)" id="${id }">重置密码</a>&nbsp;&nbsp;  <a href="deleteAdminUser.do?ids=${id }">删除</a></td>
  </tr>
  </s:iterator>
</table>
<input type="submit" value="删除"/>
</form>
  <div align="right" class="text_margin">
  [ <a href="listAgent.do?pageNum=1">首页</a> |
     <s:if test="pageNum<=1">上一页</s:if><s:else><a href="listAgent.do?pageNum=${backPage }">上一页</a></s:else>|
     <s:if test="pageNum>=pageCount">下一页</s:if><s:else><a href="listAgent.do?pageNum=${nextPage }">下一页</a></s:else> |
      <a href="listAgent.do?pageNum=${pageCount }">末 页</a>]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 第
	<select onchange="javascript:window.location='listAgent.do?pageNum='+this.value">
		<s:bean name="org.apache.struts2.util.Counter">
		<s:param name="first" value="1" />
		<s:param name="last" value="pageCount"/>
		<s:iterator>
		<option value="<s:property />"
		<s:if test="%{pageNum==(current-1)}">selected="selected"</s:if>>
		<s:property />
		</option>
		</s:iterator>
		</s:bean>
	</select>
    页 &nbsp;共${pageCount}页   
  </div>
</div>

</body>
</html>
